package com.study.bob.adapter;

/**
 * Created by bob on 2016/5/8.
 */
public class SocketClassAdapterImpl extends Socket implements SocketAdapter{

    @Override
    public Volt get30Volt() {
        Volt v = getVolts();
        return this.convertor(v,4);
    }

    @Override
    public Volt get120Volt() {
        return getVolts();
    }

    @Override
    public Volt get3Volt() {
        Volt v = getVolts();
        return convertor(v,40);
    }

    private Volt convertor(Volt v, int i ){
        return new Volt(v.getVolts()/i);
    }
}
